package com.pai4j.remote.audit;

import com.pai4j.common.bean.PAIResponseBean;
import com.pai4j.domain.dto.audit.ContentAuditRequestDTO;
import com.pai4j.domain.vo.response.audit.ContentAuditResponseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 内容审核远程服务接口
 *
 * @author: CYM-pai
 * @date: 2025/08/06 10:38
 **/
@FeignClient(name = "pai4j-audit-service", contextId = "contentAuditClient")
public interface ContentAuditClient {
    
    /**
     * 提交内容审核
     *
     * @param request 审核请求
     * @return 审核响应
     */
    @PostMapping("/audit-service/content/submit")
    PAIResponseBean<ContentAuditResponseVO> submitAudit(@RequestBody ContentAuditRequestDTO request);
    
    /**
     * 批量提交内容审核
     *
     * @param requests 批量审核请求
     * @return 批量审核响应
     */
    @PostMapping("/audit-service/content/batchSubmit")
    PAIResponseBean<List<ContentAuditResponseVO>> batchSubmitAudit(@RequestBody List<ContentAuditRequestDTO> requests);
    
    /**
     * 查询审核结果
     *
     * @param businessId 业务ID
     * @return 审核结果
     */
    @GetMapping("/audit-service/content/result/{businessId}")
    PAIResponseBean<ContentAuditResponseVO> getAuditResult(@PathVariable("businessId") String businessId);
    
    /**
     * 批量查询审核结果
     *
     * @param businessIds 业务ID列表
     * @return 批量审核结果
     */
    @PostMapping("/audit-service/content/batchResult")
    PAIResponseBean<List<ContentAuditResponseVO>> batchGetAuditResult(@RequestBody List<String> businessIds);
    
    /**
     * 取消审核
     *
     * @param businessId 业务ID
     * @return 取消结果
     */
    @PostMapping("/audit-service/content/cancel/{businessId}")
    PAIResponseBean<Boolean> cancelAudit(@PathVariable("businessId") String businessId);
    
    /**
     * 重新审核
     *
     * @param businessId 业务ID
     * @return 重新审核结果
     */
    @PostMapping("/audit-service/content/reaudit/{businessId}")
    PAIResponseBean<ContentAuditResponseVO> reaudit(@PathVariable("businessId") String businessId);
    
    /**
     * 人工审核确认
     *
     * @param businessId 业务ID
     * @param result 审核结果
     * @param comment 审核意见
     * @param auditorId 审核员ID
     * @return 确认结果
     */
    @PostMapping("/audit-service/content/manualConfirm")
    PAIResponseBean<Boolean> manualConfirm(@RequestParam("businessId") String businessId,
                                          @RequestParam("result") Integer result,
                                          @RequestParam("comment") String comment,
                                          @RequestParam("auditorId") String auditorId);
}
